<template>
  <div>
    <!-- 教师信息 -->
    <el-descriptions :column="1" border>
      <el-descriptions-item>
        <template slot="label"> 教师名称 </template>
        {{ teacherinfo.teacher_name }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 所属单位 </template>
        {{ teacherinfo.teacher_college }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 职称 </template>
        {{ teacherinfo.teacher_Workplace }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 学位 </template>
        {{ teacherinfo.teacher_degree }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 手机号 </template>
        {{ teacherinfo.teacher_phone }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> Email </template>
        {{ teacherinfo.teacher_email }}
      </el-descriptions-item>
    </el-descriptions>

    <el-button @click="goback">返回上一级</el-button>
  </div>
</template>
<script>
export default {
  created() {
    this.getTeacher();
  },
  data() {
    return {
      teacherinfo: [],
    };
  },
  methods: {
    getTeacher() {
      const n = window.location.hash.substring(17);
      // console.log(n);
      this.$http
        .get("http://127.0.0.1:8080/my/teacherinfo?id=" + n)
        .then((res) => {
          // console.log(res.data.data[0]);
          this.teacherinfo = res.data.data[0];
        });
    },
    goback() {
      this.$router.go(-1);
    },
  },
};
</script>
<style lang="less" scoped>
.el-button {
  float: right;
  margin: 20px 0;
}
</style>
